<template>
  <div class="container">
    <toolbar :title="$route.meta.title" :back="true" :styleObj="styleObj"></toolbar>
    <div class="full-container">
      <scroll @scroll="scroll">
        <!--签到-->
        <sign-view></sign-view>
        <!--签到记录-->
        <sign-history></sign-history>
      </scroll>
    </div>
  </div>
</template>

<script>
import Toolbar from "../../components/Toolbar"
import Scroll from 'components/Scroll'
import SignView from './components/Sign'
import SignHistory from './components/SignHistory'

export default {
  name: 'Sign',
  components: {
    Toolbar,
    SignView,
    SignHistory,
    Scroll
  },
  data () {
    return {
      styleObj: {
        color: '#FFF',
        background: 'transparent!important'
      }
    }
  },
  methods: {
    scroll (pos) {
      let opacity = pos.y / -140
      if(opacity <= 0) this.styleObj.color = "#FFF"
      else this.styleObj.color = "#212121"
      
      this.styleObj.background = `rgba(255,255,255, ${opacity})!important`;
    }
  }
}
</script>

<style lang="stylus" scoped>

</style>
